package com.shelpe.services.sinbad.repository.jpa;

import java.util.Date;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.shelpe.services.sinbad.entity.jpa.KeywordsLog;

public interface KeywordsLogRepository
		extends PagingAndSortingRepository<KeywordsLog, Long>, JpaSpecificationExecutor<KeywordsLog> {

	Page<KeywordsLog> findByAdgroupIDAndUpdatedTimeAfterOrderByUpdatedTimeDesc(long adgroupID, Date date,
			Pageable page);

	List<KeywordsLog> findByKeywordIDInAndUpdatedTimeAfterAndAction(List<Long> keywordIDs, Date date,
			KeywordsLog.Action action);
	
	List<KeywordsLog> findByAdgroupIDInAndActionAndUpdatedTimeAfter(List<Long> adgroupIDs,KeywordsLog.Action action,Date date);
	
	List<KeywordsLog> findByAdgroupIDInAndActionAndUpdatedTimeBefore(List<Long> adgroupIDs,KeywordsLog.Action action,Date date);
}
